<?php
  $con = mysql_connect("mysql1.000webhost.com", "a7424976_info", "thebest5");
	$res = mysql_select_db("a7424976_info");
	
	$queryres = mysql_query("select * from mode");
	$row = mysql_fetch_row($queryres);
?>
<HTML>
<HEAD>
<link rel="stylesheet" type="text/css" href="table.css"/>
<TITLE>Auto Stock&Release Security System</TITLE>
</HEAD>
<SCRIPT>
  function load(){
    var mode = <? echo $row[0];?>;
    if (mode == 0){
      document.getElementById("s1").checked = true;
      document.getElementById("cont").innerHTML = "&#51077;&#44256; &#47784;&#46300; &#46041;&#51089; &#51473;...";
    }
    else{
      document.getElementById("s2").checked = true;
      document.getElementById("cont").innerHTML = "&#52636;&#44256; &#47784;&#46300; &#46041;&#51089; &#51473;...";
    }
  }
  
  function setMode(id){
    window.location = "StockMode.php?pid=" + id;
  }
</SCRIPT>
<BODY onLoad="javascript:load();">
 <TABLE border="0">
     <thead>
	    <tr>
	       <th id="fn" scope="col" colspan="2">Auto Stock&Release Security System</th>
	    </tr>
	  </thead>
    <TR>
    <TH>   <TABLE>
    <thead>
	    <tr>
	       <th id="fn" scope="col">&#47784;&#46300;&#47484; &#49440;&#53469;&#54616;&#49464;&#50836;</th>
	    </tr>
	  </thead>
    <tr>
      <th scope="row">
      <input type="radio" name="s1" id="s1" value="&#51077;&#44256;&#47784;&#46300;" onClick="javascript:setMode(0);">&#51077;&#44256;&#47784;&#46300;
      </th>      
    </tr>
    <tr>
      <th scope="row">
      <input type="radio" name="s1" id="s2" value="&#52636;&#44256;&#47784;&#46300;" onClick="javascript:setMode(1);">&#52636;&#44256;&#47784;&#46300;
      </th>
    </tr>    
    <tr>
      <th scope="row">
      <A href="Security.html">&#48372;&#50504;&#47784;&#46300;</A>
      </th>
    </tr>
  </TABLE> </TH>
    <TH>  <TABLE BORDER="0">
    <thead>
	    <tr>
	       <th id="fn" scope="col">&#51312;&#54924;</th>
	    </tr>
	  </thead>
    <tr>
      <th scope="row"><A href="query.php?pid=0">&#51077;&#44256;</A></th>
    </tr>
    <tr>
      <th scope="row"><A href="query.php?pid=0">&#52636;&#44256;</A></th>
    </tr>
    <tr>
      <th scope="row"><A href="search.html">&#49828;&#52992;&#51460;&#47084;</A></th>
    </tr>
    </TABLE> </TH>
    </TR>
    
    <thead>
      <tr>
      
        <th scope="row" colspan="2">
  	       &#46041;&#51089;&#51473;&#51064; &#47784;&#46300;</A>
  	    </th>
  	    </TR>
  	</thead>
  	<tr>
  	  <th scope = "row" colspan="2">
  	    <div id="cont"></div>
  	  </th>
  	<tr>
    </TABLE>     
</BODY>
</HTML>